CREATE TABLE [dbo].[T_ACTIVITY_HISTORY]
(
[ACTIVITY_HISTORY_ID] [bigint] NOT NULL IDENTITY(1, 1),
[ACTIVITY_ID] [bigint] NULL,
[ACTIVITY_COMPLETION] [smallint] NOT NULL,
[ACTIVITY_HISTORY_STATUS] [bit] NOT NULL,
[CREATE_DATE] [datetime] NOT NULL,
[DISABLE_DATE] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[T_ACTIVITY_HISTORY] ADD CONSTRAINT [CHK_COMPLETION_VALUE] CHECK (([ACTIVITY_COMPLETION]>=(0) AND [ACTIVITY_COMPLETION]<=(100)))
GO
ALTER TABLE [dbo].[T_ACTIVITY_HISTORY] ADD CONSTRAINT [PK__T_ACTIVI__8AE8FB4D5481596A] PRIMARY KEY CLUSTERED  ([ACTIVITY_HISTORY_ID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[T_ACTIVITY_HISTORY] ADD CONSTRAINT [FK__T_ACTIVIT__ACTIV__4AB81AF0] FOREIGN KEY ([ACTIVITY_ID]) REFERENCES [dbo].[T_ACTIVITY] ([ACTIVITY_ID])
GO
